new Vue({
	el: "body",
	data: {
		loading: true,
		rechargeMoney: 0,
		money:0,
		isnum: false,
		userid:""
	},
	methods: {
		Recharge: function() {
			console.log(1)
			var user = AV.Object.createWithoutData('_User', this.userid);
			//修改属性
			if(this.rechargeMoney > 0) {
				this.isnum = false;
				money=this.money*1+this.rechargeMoney*1;
				console.log(money)
				user.set('Money', money);
				user.save();
				this.rechargeMoney=0;
			} else {
				this.isnum = true;
			}
		}
	},
	created: function() {
		init();
		var currentUser = AV.User.current();
		var userid = currentUser.id;
		this.userid=userid;
		var _this=this;
		var query=new AV.Query("_User");
		query.get(userid).then(function(user) {
			console.log(user);
			if(user.attributes.Money) {
				_this.money=user.attributes.Money;
			}
		})
	},
	beforeCompile: function() {
		this.loading = true;
	}
})